package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MiniCourseMapper;
import com.ruoyi.system.domain.MiniCourse;
import com.ruoyi.system.service.IMiniCourseService;

/**
 * 课程信息Service业务层处理
 * 
 * @author duantao
 * @date 2025-09-14
 */
@Service
public class MiniCourseServiceImpl implements IMiniCourseService 
{
    @Autowired
    private MiniCourseMapper miniCourseMapper;

    /**
     * 查询课程信息
     * 
     * @param courseId 课程信息主键
     * @return 课程信息
     */
    @Override
    public MiniCourse selectMiniCourseByCourseId(Long courseId)
    {
        return miniCourseMapper.selectMiniCourseByCourseId(courseId);
    }

    /**
     * 查询课程信息列表
     * 
     * @param miniCourse 课程信息
     * @return 课程信息
     */
    @Override
    public List<MiniCourse> selectMiniCourseList(MiniCourse miniCourse)
    {
        return miniCourseMapper.selectMiniCourseList(miniCourse);
    }

    /**
     * 新增课程信息
     * 
     * @param miniCourse 课程信息
     * @return 结果
     */
    @Override
    public int insertMiniCourse(MiniCourse miniCourse)
    {
        miniCourse.setCreateTime(DateUtils.getNowDate());
        return miniCourseMapper.insertMiniCourse(miniCourse);
    }

    /**
     * 修改课程信息
     * 
     * @param miniCourse 课程信息
     * @return 结果
     */
    @Override
    public int updateMiniCourse(MiniCourse miniCourse)
    {
        miniCourse.setUpdateTime(DateUtils.getNowDate());
        return miniCourseMapper.updateMiniCourse(miniCourse);
    }

    /**
     * 批量删除课程信息
     * 
     * @param courseIds 需要删除的课程信息主键
     * @return 结果
     */
    @Override
    public int deleteMiniCourseByCourseIds(Long[] courseIds)
    {
        return miniCourseMapper.deleteMiniCourseByCourseIds(courseIds);
    }

    /**
     * 删除课程信息信息
     * 
     * @param courseId 课程信息主键
     * @return 结果
     */
    @Override
    public int deleteMiniCourseByCourseId(Long courseId)
    {
        return miniCourseMapper.deleteMiniCourseByCourseId(courseId);
    }
}
